package com.ss.android.article.base.feature.e;

import com.bytedance.common.utility.UIUtils;
import com.bytedance.retrofit2.Callback;
import com.bytedance.retrofit2.ResponseWrapper;
import com.ss.android.article.base.ui.BaseActionDialog;
import com.ss.android.article.browser.R;
import com.ss.android.article.common.http.ApiError;

final class d implements Callback {
    private final ArticleShareHelper c;
    private final boolean a;
    private final com.ss.android.article.share.c.a b;

    d(ArticleShareHelper arg1, boolean arg2, com.ss.android.article.share.c.a arg3) {
        this.c = arg1;
        this.a = arg2;
        this.b = arg3;

    }

    public final void onCacheResponse(ResponseWrapper response) {
        this.c.l.wendaData.isBanComment = this.a;
        if(this.b != null && ((this.b instanceof BaseActionDialog))) {
            ((BaseActionDialog)this.b).a(this.c.o);
        }

        ArticleShareHelper v1 = this.c;
        int v0 = this.a ? R.string.wenda_baned_comment : R.string.wenda_allowed_comment;
        v1.a(0, v0);
    }

    public final void onErrorResponse(Throwable throwable) {
        int v2 = R.drawable.close_popup_textpage;
        if((throwable instanceof ApiError)) {
            UIUtils.showImageToast(this.c.mActivity, v2, ((ApiError) throwable).mErrorTips);
        }
        else {
            UIUtils.showImageToast(this.c.mActivity, v2, R.string.net_error);
        }
    }
}

